// components/countdown/countdown.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    //计时
    h:'1',
    m:'59',
    s:'59',
  },
  

  /**
   * 组件的方法列表
   */
  methods: {
    queryTime:function(){
      const that = this;
      var hou = that.data.h;
      var min =  that.data.m;
      var sec = that.data.s;
      setInterval(function(){
       sec--;
       if(sec<=0){
         sec=60;
         min--;
       }
       if(min<=0){
        min=59;
        hou--;
      }
       that.setData({
        s:(sec<10?'0'+sec:sec)
       })
       that.setData({
        m:(min<10?'0'+min:min)
       })
       that.setData({
        h:(hou<10?'0'+hou:hou)
       })
      },1000)
  
    },
  }
})
